package tile;

import java.io.File;

/**
 * Represents a tile that is represented through a TileSet 
 * by its String representation and its parent TileSet
 * 
 * @author Sebastian Audet
 */
public class Tile implements Comparable<Tile>{
    private String key;
    private TileSet keychain;
    
    public Tile(String key, TileSet keychain)
    {
	this.key=key;this.keychain=keychain;
    }
    
    public TileSet getKeyChain()
    {
	return keychain;
    }
    
    public String getString() {
	return key;
    }
    public int getLevel() {
	return keychain.getLevel();
    }

    public int compareTo(Tile o) {
	return keychain.compareTo(o.keychain);
    }
    
    public File getResource()
    {
	return keychain.getResource(key);
    }
}
